x86: simplify page reference handling for partially (in-)validated pages
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 3 Nov 2008 10:32:02 +0000 (10:32 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 3 Nov 2008 10:32:02 +0000 (10:32 +0000)
commit18a4292db0f4f65c61806a92ea4eef89418a6c1b
tree7602bc7df25393af92645909f709a507a522fad4
parent7df6b00a5824702c9f539c74b2ede76a3ebf6d47
x86: simplify page reference handling for partially (in-)validated pages

Simplify general page reference management for preempted (partially
[in-]validated) pages: Reserve on reference that can be acquired
without the risk of overflowing the reference count, thus allowing to
have a simplified get_page() equivalent that cannot fail (but must be
used with care).

Doing this conversion pointed out a latent issue in the changes done
previously in this area: The extra reference must be acquired before
the 'normal' reference gets dropped, so the patch fixes this at once
in both the alloc_page_type() and free_page_type() paths (it's really
only the latter that failed to work with the change described above).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/mm.c